
#ifndef __VIDEO_FACTORY_H
#define __VIDEO_FACTORY_H

#include "VideoRGB.h"
#include "VideoRAW.h"

class VideoFactory 
{
	const VideoFiles	videoFiles;
	int minimum;
	int maximum;

public:

	VideoFactory( const Settings &_settings ) 
		:	videoFiles( _settings.GetVideoDirectory() ),
			minimum( _settings.GetLoopMinimum() ),
			maximum( _settings.GetLoopMaximum() ) {
	}

	virtual ~VideoFactory(){}

	IVideoDecoder *CreateVideo() const {

		int loopCount = minimum;
		if(minimum != maximum)
			loopCount = minimum + (rand() % ((1+maximum)-minimum));

		return new VideoRGB(videoFiles.GetRandom(), loopCount);
//		return new VideoRAW(videoFiles.GetRandom(), loopCount);
	}

	void KillVideo( IVideoDecoder *vid ) const {

		delete vid;
	}
};

#endif /*** __VIDEO_FACTORY_H ***/

